import type { App, Plugin } from 'vue'
import * as components from './components'
import pkg from '../package.json'

// 按需导入
// import { Btn } from '@project/components'
export * from './components'

// 全局注册
// import common from '@project/components'
// app.use(common)

export default {
    install(app: App) {
        Object.entries(components).forEach(([_name, comp]) => {
            // console.log(_name, comp)
            if (comp.install)
                app.use(comp as any)
        })
        app.component('')
    },
    version: pkg.version,
} as Plugin
